package com.miracle.moa.manager.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * 分页插件
 * @author : miracle
 * @version : 1.0.0
 * @date : 2021/3/21 11:47
 */
@Configuration
@EnableTransactionManagement //启注解事务管理  需要事务的 service 方法上加上 @Transactional即可
public class MybatisPlusConfig {
    /**
     * 分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }
}